package com.pms.actions;

import java.util.Hashtable;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.pms.framework.Action;

public class LogoutAction implements Action {
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		Hashtable error = new Hashtable();

		if(request.getSession().getAttribute("user") != null){
			error.put("error", "Your are successfully logged out.");
			request.setAttribute("error",error);
			request.getSession().removeAttribute("user");
			request.getSession().removeAttribute("isSuperAdmin");
		}
		
		request.setAttribute("nextPageToken", "needLogin");
		request.setAttribute("plainPage", "TRUE");

	}
}
